package com.example.mybatisplusdemo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * @author hh
 * @since 2023/2/4
 */
@Data
@Accessors(chain = true)
@TableName("product")
public class ProductEntity implements Serializable {
    private static final long serialVersionUID = -6854775622085923454L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    private String name;
    private Integer num;
    /**
     * 用注解@Version来开启乐观锁
     */
    @Version
    private Integer version;
}
